/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package agb.Modelo;


import agb.Conexion.Conexion;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Vector;

/**
 *
 * @author Alan Cabrera Abanto
 */
/**
 *
 * @author Servidor
 */
public class PromediosExo {
    private double nota1, nota2, nota3, mensual, promedioMes, 
            promedioSemanal, mes1, mes2, promedioBimestral,notaBimestral;
    private String curso, alumno;
    private double semanal1,semanal2,semanal3,semanal4,semanal5,semanal6,semanal7,semanal8,semanal9,
            semanal10,semanal11,semanal12,semanal13,semanal14,semanal15,semanal16,semanal17,semanal18,
            semanal19, semanal20, semanal21, semanal22,semanal23, semanal24,
            mensual1,mensual2,mensual3,mensual4,mensual5,mensual6,mensual7,mensual8, bimestral1,bimestral2,bimestral3;
    private double promBimestre1, promBimestre2, promBimestre3,promBimestre4Proy;
    
    public double getMensual1() {
        return mensual1;
    }

    public void setMensual1(double mensual1) {
        this.mensual1 = mensual1;
    }

    public double getMensual2() {
        return mensual2;
    }

    public void setMensual2(double mensual2) {
        this.mensual2 = mensual2;
    }

    public double getMensual3() {
        return mensual3;
    }

    public void setMensual3(double mensual3) {
        this.mensual3 = mensual3;
    }

    public double getMensual4() {
        return mensual4;
    }

    public void setMensual4(double mensual4) {
        this.mensual4 = mensual4;
    }

    public double getMensual5() {
        return mensual5;
    }

    public void setMensual5(double mensual5) {
        this.mensual5 = mensual5;
    }

    public double getMensual6() {
        return mensual6;
    }

    public void setMensual6(double mensual6) {
        this.mensual6 = mensual6;
    }

    public double getSemanal1() {
        return semanal1;
    }

    public void setSemanal1(double semanal1) {
        this.semanal1 = semanal1;
    }

    public double getSemanal10() {
        return semanal10;
    }

    public void setSemanal10(double semanal10) {
        this.semanal10 = semanal10;
    }

    public double getSemanal11() {
        return semanal11;
    }

    public void setSemanal11(double semanal11) {
        this.semanal11 = semanal11;
    }

    public double getSemanal12() {
        return semanal12;
    }

    public void setSemanal12(double semanal12) {
        this.semanal12 = semanal12;
    }

    public double getSemanal13() {
        return semanal13;
    }

    public void setSemanal13(double semanal13) {
        this.semanal13 = semanal13;
    }

    public double getSemanal14() {
        return semanal14;
    }

    public void setSemanal14(double semanal14) {
        this.semanal14 = semanal14;
    }

    public double getSemanal15() {
        return semanal15;
    }

    public void setSemanal15(double semanal15) {
        this.semanal15 = semanal15;
    }

    public double getSemanal16() {
        return semanal16;
    }

    public void setSemanal16(double semanal16) {
        this.semanal16 = semanal16;
    }

    public double getSemanal17() {
        return semanal17;
    }

    public void setSemanal17(double semanal17) {
        this.semanal17 = semanal17;
    }

    public double getSemanal18() {
        return semanal18;
    }

    public void setSemanal18(double semanal18) {
        this.semanal18 = semanal18;
    }

    public double getSemanal2() {
        return semanal2;
    }

    public void setSemanal2(double semanal2) {
        this.semanal2 = semanal2;
    }

    public double getSemanal3() {
        return semanal3;
    }

    public void setSemanal3(double semanal3) {
        this.semanal3 = semanal3;
    }

    public double getSemanal4() {
        return semanal4;
    }

    public void setSemanal4(double semanal4) {
        this.semanal4 = semanal4;
    }

    public double getSemanal5() {
        return semanal5;
    }

    public void setSemanal5(double semanal5) {
        this.semanal5 = semanal5;
    }

    public double getSemanal6() {
        return semanal6;
    }

    public void setSemanal6(double semanal6) {
        this.semanal6 = semanal6;
    }

    public double getSemanal7() {
        return semanal7;
    }

    public void setSemanal7(double semanal7) {
        this.semanal7 = semanal7;
    }

    public double getSemanal8() {
        return semanal8;
    }

    public void setSemanal8(double semanal8) {
        this.semanal8 = semanal8;
    }

    public double getSemanal9() {
        return semanal9;
    }

    public void setSemanal9(double semanal9) {
        this.semanal9 = semanal9;
    }
            

    
    public String getAlumno() {
        return alumno;
    }

    public void setAlumno(String alumno) {
        this.alumno = alumno;
    }
    
    
    public double getNota1() {
        return nota1;
    }

    public void setNota1(double nota1) {
        this.nota1 = nota1;
    }

    public double getNota2() {
        return nota2;
    }

    public void setNota2(double nota2) {
        this.nota2 = nota2;
    }

    public double getNota3() {
        return nota3;
    }

    public void setNota3(double nota3) {
        this.nota3 = nota3;
    }

    public double getMensual() {
        return mensual;
    }

    public void setMensual(double mensual) {
        this.mensual = mensual;
    }

    public double getBimestral1() {
        return bimestral1;
    }

    public void setBimestral1(double bimestral1) {
        this.bimestral1 = bimestral1;
    }

    public double getBimestral2() {
        return bimestral2;
    }

    public void setBimestral2(double bimestral2) {
        this.bimestral2 = bimestral2;
    }

    public double getBimestral3() {
        return bimestral3;
    }

    public void setBimestral3(double bimestral3) {
        this.bimestral3 = bimestral3;
    }

    public double getPromBimestre1() {
        return promBimestre1;
    }

    public void setPromBimestre1(double promBimestre1) {
        this.promBimestre1 = promBimestre1;
    }

    public double getPromBimestre2() {
        return promBimestre2;
    }

    public void setPromBimestre2(double promBimestre2) {
        this.promBimestre2 = promBimestre2;
    }

    public double getPromBimestre3() {
        return promBimestre3;
    }

    public void setPromBimestre3(double promBimestre3) {
        this.promBimestre3 = promBimestre3;
    }
    
    public String getCurso() {
        return curso;
    }

    public void setCurso(String curso) {
        this.curso = curso;
    }

    public double getPromedioMes() {
        return promedioMes;
    }

    public void setPromedioMes(double promedioMes) {
        this.promedioMes = promedioMes;
    }

    public double getPromedioSemanal() {
        return promedioSemanal;
    }

    public void setPromedioSemanal(double promedioSemanal) {
        this.promedioSemanal = promedioSemanal;
    }

    public double getMes1() {
        return mes1;
    }

    public void setMes1(double mes1) {
        this.mes1 = mes1;
    }

    public double getMes2() {
        return mes2;
    }

    public void setMes2(double mes2) {
        this.mes2 = mes2;
    }

    public double getPromedioBimestral() {
        return promedioBimestral;
    }

    public void setPromedioBimestral(double promedioBimestral) {
        this.promedioBimestral = promedioBimestral;
    }  

    public double getNotaBimestral() {
        return notaBimestral;
    }

    public void setNotaBimestral(double notaBimestral) {
        this.notaBimestral = notaBimestral;
    }

    public double getMensual7() {
        return mensual7;
    }

    public void setMensual7(double mensual7) {
        this.mensual7 = mensual7;
    }

    public double getMensual8() {
        return mensual8;
    }

    public void setMensual8(double mensual8) {
        this.mensual8 = mensual8;
    }

    public double getSemanal19() {
        return semanal19;
    }

    public void setSemanal19(double semanal19) {
        this.semanal19 = semanal19;
    }

    public double getSemanal20() {
        return semanal20;
    }

    public void setSemanal20(double semanal20) {
        this.semanal20 = semanal20;
    }

    public double getSemanal21() {
        return semanal21;
    }

    public void setSemanal21(double semanal21) {
        this.semanal21 = semanal21;
    }

    public double getSemanal22() {
        return semanal22;
    }

    public void setSemanal22(double semanal22) {
        this.semanal22 = semanal22;
    }

    public double getSemanal23() {
        return semanal23;
    }

    public void setSemanal23(double semanal23) {
        this.semanal23 = semanal23;
    }

    public double getSemanal24() {
        return semanal24;
    }

    public void setSemanal24(double semanal24) {
        this.semanal24 = semanal24;
    }

    public double getPromBimestre4Proy() {
        return promBimestre4Proy;
    }

    public void setPromBimestre4Proy(double promBimestreProy) {
        this.promBimestre4Proy = promBimestreProy;
    }

    
    public List<PromediosExo>calculaPromBimestral(List<PromediosExo> PromMensuales,int pesoPromMensual, int PesoBimestral){
        int peso = (pesoPromMensual * 2) + PesoBimestral;
        
        int nuevoPeso = peso;
        for(PromediosExo o: PromMensuales){
            if(o.getMes1()==0){
                peso = peso - pesoPromMensual;
            }
            if(o.getMes2()==0){
                 peso = peso - pesoPromMensual;
            }
            if(o.getNotaBimestral()==0){
                 peso = peso - PesoBimestral;
            }
            if(peso==0){
                 peso = 1;
            }
            double promBimestral = 0;
            promBimestral = ((o.getMes1()* pesoPromMensual) + (o.getMes2() * pesoPromMensual) + (o.getNotaBimestral()* PesoBimestral))/peso;
            o.setPromedioBimestral(promBimestral);
            peso = nuevoPeso;
        }
        return PromMensuales;
    }
    
        public List<PromediosExo>calculaPromBimestralProy(List<PromediosExo> PromMensuales,int pesoPromMensual){
        int peso = (pesoPromMensual * 2);
        
        int nuevoPeso = peso;
        for(PromediosExo o: PromMensuales){
            if(o.getMes1()==0){
                peso = peso - pesoPromMensual;
            }
            
            if(o.getMes2()==0){
//                 peso = peso - pesoPromMensual;
            }
            
            if(peso==0){
                 peso = 1;
            }
            double promBimestral = 0;
            promBimestral = ((o.getMes1()* pesoPromMensual) + (o.getMes2() * pesoPromMensual))/peso;
            o.setPromedioBimestral(promBimestral);
            peso = nuevoPeso;
        }
        return PromMensuales;
    }
    
    

   public  double PesoMes(int cod_Nivel){
        double peso = 0;
        Connection cn = null;
        PreparedStatement ps = null;
        ResultSet rs = null;
        String sql = "  select pesoExamenMensual(max(p.cod_progannoacad))    " +
                "from programacion_annoacademico  p " +
                "inner join  tipo_progannoacad t on p.cod_tipoprogannoacad =  t.cod_tipoprogannoacad    " +
                "where  t.cod_tipoprogannoacad = 1 and p.cod_nivel = ? " ;          
        try{             
            cn = Conexion.getConexion();
            ps = cn.prepareStatement(sql);
            ps.setInt(1, cod_Nivel);            
            rs = ps.executeQuery();
            while(rs.next()){
                peso = rs.getDouble(1);
            }
        Conexion.cerrarPreparedStatement(ps);
        Conexion.cerrarConexion(cn);
        }catch(SQLException ex){
            ex.printStackTrace();
            Conexion.cerrarPreparedStatement(ps);
            Conexion.cerrarConexion(cn);
        }catch(Exception ex){
            ex.printStackTrace();
        }
        return peso;
    }    
   
   public  int PesoPromedioMes(int cod_Nivel){
        int peso = 0;
        Connection cn = null;
        PreparedStatement ps = null;
        ResultSet rs = null;
        String sql = "  select pesoPromMes(max(p.cod_progannoacad))    " +
                "from programacion_annoacademico  p " +
                "inner join  tipo_progannoacad t on p.cod_tipoprogannoacad =  t.cod_tipoprogannoacad    " +
                "where  t.cod_tipoprogannoacad = 1 and p.cod_nivel = ? " ;          
        try{             
            cn = Conexion.getConexion();
            ps = cn.prepareStatement(sql);
            ps.setInt(1, cod_Nivel);            
            rs = ps.executeQuery();
            while(rs.next()){
                peso = rs.getInt(1);
            }
        Conexion.cerrarPreparedStatement(ps);
        Conexion.cerrarConexion(cn);
        }catch(SQLException ex){
            ex.printStackTrace();
            Conexion.cerrarPreparedStatement(ps);
            Conexion.cerrarConexion(cn);
        }catch(Exception ex){
            ex.printStackTrace();
        }
        return peso;
    }
   
    public  double PesoBimTrimestral(int cod_Nivel){
        double peso = 0;
        Connection cn = null;
        PreparedStatement ps = null;
        ResultSet rs = null;
        String sql = "   select pesoTrimestre(max(p.cod_progannoacad))    " +
                "from programacion_annoacademico  p " +
                "inner join tipo_progannoacad t on p.cod_tipoprogannoacad =  t.cod_tipoprogannoacad    " +
                "where  t.cod_tipoprogannoacad = 1 and p.cod_nivel = ? " ;          
        try{             
            cn = Conexion.getConexion();
            ps = cn.prepareStatement(sql);
            ps.setInt(1, cod_Nivel);            
            rs = ps.executeQuery();
            while(rs.next()){
                peso = rs.getDouble(1);
            }
        Conexion.cerrarPreparedStatement(ps);
        Conexion.cerrarConexion(cn);
        }catch(SQLException ex){
            ex.printStackTrace();
            Conexion.cerrarPreparedStatement(ps);
            Conexion.cerrarConexion(cn);
        }catch(Exception ex){
            ex.printStackTrace();
        }
        return peso;
    }
    
   public  List<PromediosExo> calculaPromedio(List<PromediosExo> L, int pesoSemanal, int pesoMensual){
        int nuevoPesoMensual = pesoMensual;
        int nuevoPesoSemanal = pesoSemanal;
        double  promSemanal = 0.0;
        double  promMensual = 0.0;
        for(PromediosExo o :L){
            if(o.getNota1()==0){
                pesoSemanal = pesoSemanal - 1;               
            }
            if(o.getNota2()==0){
                pesoSemanal = pesoSemanal - 1;                  
            }
            if(o.getNota3()==0){       
                pesoSemanal = pesoSemanal - 1;                     
            }
            if(pesoSemanal == 0){
                pesoSemanal = 1;
            }
            promSemanal = (o.getNota1() + o.getNota2() + o.getNota3())/pesoSemanal;
            o.setPromedioSemanal(promSemanal);
            pesoSemanal = nuevoPesoSemanal;
            if(o.getMensual()==0){       
                pesoMensual = 0;                     
            }
            int pesoPromMensual  = 1;
            if(o.getPromedioSemanal()==0){
                pesoPromMensual = 0;
            }
            int pesoFinal = pesoMensual + pesoPromMensual;
            if(pesoFinal==0){
                pesoFinal = 1;
            }
            if(o.getMensual()!=0)
                promMensual = (o.getPromedioSemanal() + (o.getMensual() * pesoMensual))/pesoFinal;
            else
                promMensual = 0;
            o.setPromedioMes(promMensual);
            pesoMensual = nuevoPesoMensual;      
        }
        return L;    
    }
   
     public  List<PromediosExo> notasGlobales(int cod_persona){
        PromediosExo oPromedio = null;
        List<PromediosExo> LNotas = new ArrayList<PromediosExo>();
        Connection cn = null;
        PreparedStatement ps = null;
        ResultSet rs = null;
        String sql = "select notas.NOMBRE, "
                + "MAX(notas.semanal_1) as semanal_1,MAX(notas.semanal_2) as semanal_2,MAX(notas.semanal_3) as semanal_3,MAX(notas.mensual_1) as mensual_1,                      "
                + "MAX(notas.semanal_4) as semanal_4,MAX(notas.semanal_5) as semanal_5,MAX(notas.semanal_6) as semanal_6,MAX(notas.mensual_2) as mensual_2,                      "
                + "MAX(notas.semanal_7) as semanal_7,MAX(notas.semanal_8) as semanal_8,MAX(notas.semanal_9) as semanal_9,MAX(notas.mensual_3) as mensual_3,                      "
                + "MAX(notas.semanal_10)as semanal_10,MAX(notas.semanal_11)as semanal_11,MAX(notas.semanal_12) as semanal_12 ,MAX(notas.mensual_4) as mensual_4,                      "
                + "MAX(notas.semanal_13)as semanal_13,MAX(notas.semanal_14) as semanal_14,MAX(notas.semanal_15) as semanal_15 ,MAX(notas.mensual_5) as mensual_5,                      "
                + "MAX(notas.semanal_16)as semanal_16,MAX(notas.semanal_17) as semanal_17,MAX(notas.semanal_18) as semanal_18 ,MAX(notas.mensual_6) as mensual_6, "
                + "MAX(Bimestre_1)AS bimestral1,"
                + "MAX(Bimestre_2)AS BIMESTRAL2,"
                + "MAX(Bimestre_3)AS BIMESTRAL3, "
                + "MAX(notas.semanal_19)as semanal_19,MAX(notas.semanal_20) as semanal_20,MAX(notas.semanal_21) as semanal_21 ,MAX(notas.mensual_7) as mensual_7, "
                + "MAX(notas.semanal_22)as semanal_22,MAX(notas.semanal_23) as semanal_23,MAX(notas.semanal_24) as semanal_24 ,MAX(notas.mensual_8) as mensual_8 "
                + "from(                  "
                    + "SELECT CR.NOMBRE,                 "
                    + "CASE WHEN E.codevaluacion = 1 THEN C.NOTA ELSE 0 END as semanal_1,                 "
                    + "CASE WHEN E.codevaluacion = 2 THEN C.NOTA ELSE 0 END as semanal_2,                 "
                    + "CASE WHEN E.codevaluacion = 3 THEN C.NOTA ELSE 0 END as semanal_3,                 "
                    + "CASE WHEN E.codevaluacion = 6 THEN C.NOTA ELSE 0 END as mensual_1,                 "
                    + "CASE WHEN E.codevaluacion = 4 THEN C.NOTA ELSE 0 END as semanal_4,                 "
                    + "CASE WHEN E.codevaluacion = 5 THEN C.NOTA ELSE 0 END as semanal_5,                 "
                    + "CASE WHEN E.codevaluacion = 7 THEN C.NOTA ELSE 0 END as semanal_6,                 "
                    + "CASE WHEN E.codevaluacion = 12 THEN C.NOTA ELSE 0 END as mensual_2,                 "
                    + "CASE WHEN E.codevaluacion = 8 THEN C.NOTA ELSE 0 END as semanal_7,                 "
                    + "CASE WHEN E.codevaluacion = 10 THEN C.NOTA ELSE 0 END as semanal_8,                 "
                    + "CASE WHEN E.codevaluacion = 11 THEN C.NOTA ELSE 0 END as semanal_9,                 "
                    + "CASE WHEN E.codevaluacion = 16 THEN C.NOTA ELSE 0 END as mensual_3,                 "
                    + "CASE WHEN E.codevaluacion = 13 THEN C.NOTA ELSE 0 END as semanal_10,                 "
                    + "CASE WHEN E.codevaluacion = 14 THEN C.NOTA ELSE 0 END as semanal_11,                 "
                    + "CASE WHEN E.codevaluacion = 15 THEN C.NOTA ELSE 0 END as semanal_12,                 "
                    + "CASE WHEN E.codevaluacion = 18 THEN C.NOTA ELSE 0 END as mensual_4,                 "
                    + "CASE WHEN E.codevaluacion = 30 THEN C.NOTA ELSE 0 END as semanal_13,                 "
                    + "CASE WHEN E.codevaluacion = 31 THEN C.NOTA ELSE 0 END as semanal_14,                 "
                    + "CASE WHEN E.codevaluacion = 32 THEN C.NOTA ELSE 0 END as semanal_15,                 "
                    + "CASE WHEN E.codevaluacion = 20 THEN C.NOTA ELSE 0 END as mensual_5,                 "
                    + "CASE WHEN E.codevaluacion = 33 THEN C.NOTA ELSE 0 END as semanal_16,                 "
                    + "CASE WHEN E.codevaluacion = 34 THEN C.NOTA ELSE 0 END as semanal_17,                 "
                    + "CASE WHEN E.codevaluacion = 35 THEN C.NOTA ELSE 0 END as semanal_18,                 "
                    + "CASE WHEN E.codevaluacion = 21 THEN C.NOTA ELSE 0 END as mensual_6,                 "
                    + "CASE WHEN E.codevaluacion = 9 THEN C.NOTA ELSE 0 END as Bimestre_1, "
                    + "CASE WHEN E.codevaluacion = 19 THEN C.NOTA ELSE 0 END as Bimestre_2,"
                    + "CASE WHEN E.codevaluacion = 23 THEN C.NOTA ELSE 0 END as Bimestre_3,  "
                    + "CASE WHEN E.codevaluacion = 36 THEN C.NOTA ELSE 0 END as semanal_19, " 
                    + "CASE WHEN E.codevaluacion = 37 THEN C.NOTA ELSE 0 END as semanal_20, " 
                    + "CASE WHEN E.codevaluacion = 38 THEN C.NOTA ELSE 0 END as semanal_21, " 
                    + "CASE WHEN E.codevaluacion = 24 THEN C.NOTA ELSE 0 END as mensual_7, " 
                    + "CASE WHEN E.codevaluacion = 39 THEN C.NOTA ELSE 0 END as semanal_22, " 
                    + "CASE WHEN E.codevaluacion = 40 THEN C.NOTA ELSE 0 END as semanal_23, " 
                    + "CASE WHEN E.codevaluacion = 41 THEN C.NOTA ELSE 0 END as semanal_24, " 
                    + "CASE WHEN E.codevaluacion = 25 THEN C.NOTA ELSE 0 END as mensual_8 " 
                    + "FROM MATRICULA M                 "
                    + "LEFT JOIN calificacion C ON M.cod_matricula = C.cod_matricula                 "
                    + "INNER JOIN CURSO CR ON CR.cod_curso = C.cod_curso                 "
                    + "INNER JOIN evaluacion_programada EP ON EP.codevaluacionprog =  C.codevaluacionprog                 "
                    + "INNER JOIN evaluacion E ON E.codevaluacion = EP.codevaluacion                 "
                    + "WHERE M.cod_persona = ? "
                    + "AND EXTRACT(YEAR  FROM EP.fecha_registro) = (SELECT TO_CHAR(fecha_registro,'YYYY') FROM matricula 	WHERE cod_persona = ? 	ORDER BY cod_matricula DESC 	LIMIT 1) "
                    + "AND (E.codevaluacion = 1 OR E.codevaluacion = 2 or E.codevaluacion = 3 or E.codevaluacion = 6 or                 "
                    + "E.codevaluacion = 4 OR E.codevaluacion = 5 or E.codevaluacion = 7 or E.codevaluacion = 12 or                 "
                    + "E.codevaluacion = 8 OR E.codevaluacion = 10 or E.codevaluacion = 11 or E.codevaluacion = 16 or                 "
                    + "E.codevaluacion = 13 OR E.codevaluacion = 14 or E.codevaluacion = 15 or E.codevaluacion = 18 or                 "
                    + "E.codevaluacion = 30 OR E.codevaluacion = 31 or E.codevaluacion = 32 or E.codevaluacion = 20 or                 "
                    + "E.codevaluacion = 33 OR E.codevaluacion = 34 or E.codevaluacion = 35 or E.codevaluacion = 21 or "
                    + "E.codevaluacion = 9 or "
                    + "E.codevaluacion = 19 OR "
                    + "E.codevaluacion = 23 or "
                    + "E.codevaluacion = 36 OR E.codevaluacion = 37 or E.codevaluacion = 38 or E.codevaluacion = 24 or "
                    + "E.codevaluacion = 39 OR E.codevaluacion = 40 or E.codevaluacion = 41 or E.codevaluacion = 25 "
                    + ")                 "
                    + "ORDER BY EP.fecha_registro,CR.nombre                  "
                + ") as notas group by notas.NOMBRE" ;                 
        try{             
            cn = Conexion.getConexion();
            ps = cn.prepareStatement(sql);
            ps.setInt(1, cod_persona);
            ps.setInt(2, cod_persona);
            rs = ps.executeQuery();
            while(rs.next()){
                oPromedio = new PromediosExo();
                oPromedio.setCurso(rs.getString(1));
                oPromedio.setSemanal1(rs.getDouble(2));
                oPromedio.setSemanal2(rs.getDouble(3));
                oPromedio.setSemanal3(rs.getDouble(4));
                oPromedio.setMensual1(rs.getDouble(5));
                oPromedio.setSemanal4(rs.getDouble(6));
                oPromedio.setSemanal5(rs.getDouble(7));
                oPromedio.setSemanal6(rs.getDouble(8));
                oPromedio.setMensual2(rs.getDouble(9));
                oPromedio.setSemanal7(rs.getDouble(10));
                oPromedio.setSemanal8(rs.getDouble(11));
                oPromedio.setSemanal9(rs.getDouble(12));
                oPromedio.setMensual3(rs.getDouble(13));
                oPromedio.setSemanal10(rs.getDouble(14));
                oPromedio.setSemanal11(rs.getDouble(15));
                oPromedio.setSemanal12(rs.getDouble(16));
                oPromedio.setMensual4(rs.getDouble(17));
                oPromedio.setSemanal13(rs.getDouble(18));
                oPromedio.setSemanal14(rs.getDouble(19));
                oPromedio.setSemanal15(rs.getDouble(20));
                oPromedio.setMensual5(rs.getDouble(21));
                oPromedio.setSemanal16(rs.getDouble(22));
                oPromedio.setSemanal17(rs.getDouble(23));
                oPromedio.setSemanal18(rs.getDouble(24));
                oPromedio.setMensual6(rs.getDouble(25));
                oPromedio.setBimestral1(rs.getDouble(26));
                oPromedio.setBimestral2(rs.getDouble(27));
                oPromedio.setBimestral3(rs.getDouble(28));
                oPromedio.setSemanal19(rs.getDouble(29));
                oPromedio.setSemanal20(rs.getDouble(30));
                oPromedio.setSemanal21(rs.getDouble(31));
                oPromedio.setMensual7(rs.getDouble(32));
                oPromedio.setSemanal22(rs.getDouble(33));
                oPromedio.setSemanal23(rs.getDouble(34));
                oPromedio.setSemanal24(rs.getDouble(35));
                oPromedio.setMensual8(rs.getDouble(36));
                LNotas.add(oPromedio);
            }
        Conexion.cerrarPreparedStatement(ps);
        Conexion.cerrarConexion(cn);
        }catch(SQLException ex){
            ex.printStackTrace();
            Conexion.cerrarPreparedStatement(ps);
            Conexion.cerrarConexion(cn);
        }catch(Exception ex){
            ex.printStackTrace();
        }
        return LNotas;
    }
}
